package com.lion.tag.input;

import java.io.IOException;

import javax.servlet.jsp.JspException;

import com.lion.tag.LionBaseTag;
import com.lion.tag.util.AppendUtil;

public class ComboOption extends LionBaseTag {
	private static final long serialVersionUID = -6252212709853499983L;
	private String value;

	@Override
	public int doStartTag() throws JspException {
		StringBuilder sb = new StringBuilder(200);
		sb.append("<option ");
		sb = AppendUtil.addAttribute(sb, "value", value);
		sb.append(">");
		try {
			pageContext.getOut().write(sb.toString());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return EVAL_BODY_INCLUDE;// 表示标签之间的内容被正常执行
	}

	@Override
	public int doEndTag() throws JspException {
		try {
			pageContext.getOut().write("</option>");
		} catch (IOException e) {
			e.printStackTrace();
		}
		return EVAL_PAGE;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
}
